package reflect;


import java.lang.reflect.Method;

public class ReflectDemo5 {
    public static void main(String[] args) throws Exception{
        Class cls = Class.forName("reflect.Person");
        Object obj = cls.newInstance();
        Method method = cls.getMethod("doSomething", String.class);
        method.invoke(obj);

        Method method1 = cls.getMethod("doSomething", String.class,int.class);
        method.invoke(obj,"我",12);

    }
}
